package com.durian.ui.adapter.multi;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import android.view.ViewGroup;

/**
 * 说明：TypePool
 * <p/>
 * 作者：fanly
 * <p/>
 * 类型：interface
 * <p/>
 * 时间：2016/11/28 15:11
 * <p/>
 * 版本：version 1.0
 */
public interface TypePool {

    void offsetPosition(int offset);

    void register(@NonNull Class<?> clazz, @NonNull ViewProvider provider);

    RecyclerView.ViewHolder createViewHolder(MultiTypeAdapter adapter,ViewGroup parent, int viewType);

    void bindViewHolder(MultiTypeAdapter adapter, RecyclerView.ViewHolder holder, int position);

    <T> int getViewTypeByClass(@NonNull Class<?> clazz,@NonNull T item);

    <T> ViewProvider getViewProviderByItem(@NonNull Class<?> clazz,@NonNull T item);

    void onDestroy();
}
